Header
	title   = "Jumalauta - Face of Jesus"
	music   = "data/paska.ogg"
	bpm     = 130
End

Resources
	jesus1_bw  = image( "data/images/jesse.jpg" )
	jesus1_col = image( "data/images/jessec.jpg" )
	jesus2_bw  = image( "data/images/jesse2.jpg" )
	bg1        = image( "data/images/ripped.jpg" )
	buf        = buffer()
	jml        = image( "data/images/jml.jpg" )
	mooses     = image( "data/images/reggiewithcommandments.jpg" )
	ikoni      = image( "data/images/ikoni.jpg" )
	patsas     = image( "data/images/patsas.jpg" )
	vastaus    = image( "data/images/answer.jpg" )
	
	// puklake.3ds
	sphere2_.bmp = image( "data/images/sphere2_.jpg" )
	icosahed.bmp = image( "data/images/icosahed.jpg" )
	// lol.3ds
	lol.jpg      = buffer()
End

Objects
	cam    = camera(k)
	back   = layer( bg1 )
	obu1   = 3ds( "data/3ds/puklake.3ds" )
	obu2   = 3ds( "data/3ds/lol.3ds" )
	layer1 = layer( jesus1_bw, jesus2_bw )
	layer2 = layer( jesus1_col, jesus2_bw )
	glow   = layer( lol.jpg )
	layer3 = layer( jml, mooses, ikoni, patsas, vastaus )
End

Script
	#0.0 glow.feedback = 0.1
	#0.0 layer3.blending = 1
	
	#0.0 run( intro )
	#16.0 run( scene1 )
	
	#24.0 run( scene2 )
	#32.0 run( scene2 )
	#32.0 run( fist_4bars )
	#36.0 run( fist_4bars )
	
	#40.0 run( scene1  )
	#40.0 run( fist_4bars )
	#44.0 run( fist_4bars )
	
	#48.0 run( scene1 )
	#48.0 run( glowVariation1 )
	
	#56.0 run( scene1 )
	#56.0 run( glowVariation1 )
	#56.0 enable( layer3 )
	#56.0 layer3.zoom = 100
	#56.0 layer3.show = 0 to 32 in #8.0

	#64.0 run( scene1 )
	#64.0 run( glowVariation1 )
	#64.0 layer3.show = 0 to 256 in #8.0
	
	#72.0 run( glowVariation1 )
	#72.0 disable( cam, obu1, obu2, layer1, layer2, back, glow )
	#72.0 enable( layer3 )
        #72.0 layer3.show = 0
	#72.0 layer3.zoom = 100 to 50 in #4.0
	#76.0 layer3.brightness = 1 to 0 in #1.0
End

Sub:intro
	#0.0 enable( layer1, layer2 )
	#0.0 disable( cam, obu1, back, glow )
	#0.0 layer1.blending = 1
	#0.0 layer2.blending = 1
	
	#0.0 layer2.alpha = 0
	#0.0 layer1.alpha = 0 to 1 in #4.0
	#0.0 layer1.zoom = 200 to 100 in #8.0
	#0.0 layer2.zoom = 200 to 100 in #8.0

	#4.0 layer1.alpha = 1 to 0 in #4.0
	#4.0 layer2.alpha = 0 to 1 in #4.0
	
	#8.0 layer1.show = 1
	#8.0 layer1.alpha = 0 to 1 in #1.0
	#8.0 layer2.alpha = 1 to 0 in #1.0
	#8.0 layer1.zoom = 100 to 300 in #8.0
	
	#9.0 layer2.show = 1
	#9.0 layer2.alpha = 0 to 1 in #3.0
	#9.0 layer2.zoom = 100 to 300 in #7.0
	
	//#12.0 layer1.alpha = 1 to 0 in #4.0
	#12.0 layer1.g = 1 to 0 in #4.0
	#12.0 layer1.b = 1 to 0 in #4.0
	#12.0 layer2.g = 1 to 0 in #4.0
	#12.0 layer2.b = 1 to 0 in #4.0
	
	#12.0 layer1.rotate = 0 to -15 in #4.0
	#12.0 layer2.rotate = 0 to 15 in #4.0
	
	#16.0 disable( layer1, layer2 )
End

Sub:scene1
	#0.0 enable( cam, obu1, glow, back )
	
	#0.0 layer1.blending = 1
	#0.0 layer1.alpha = 1
	#0.0 layer1.zoom = 100 to 300 in #8.0
	#0.0 layer1.rotate = 0 to 60 in #8.0
	
	#0.0 back.r = 0
	#0.0 back.g = 0.5
	#0.0 back.brightness = 0.2 to 0.7 in #8.0
		
	#0.0 glow.blending = 1
	#0.0 glow.renderToBuffer = 1
	
	#0.0 obu1.rotate.x = 0 to 600 in #8.0
	#0.0 obu1.rotate.y = 0 to 500 in #8.0
	
	#0.0 run( scene1_randomCam_bar )
	#1.0 run( scene1_randomCam_bar )
	#2.0 run( scene1_randomCam_bar )
	#3.0 run( scene1_randomCam_bar )
	#4.0 run( scene1_randomCam_bar )
	#5.0 run( scene1_randomCam_bar )
	#6.0 run( scene1_randomCam_bar )
	#7.0 run( scene1_randomCam_bar )
End

Sub:scene1_randomCam_bar
	#0.0 cam.pos.x = ( rand( -15, 10 ) ) to ( rand( -10, 15 ) ) in #0.1
	#0.0 cam.pos.y = ( rand( -15, 10 ) ) to ( rand( -10, 15 ) ) in #0.1
	#0.0 cam.pos.z = 10

	#0.1 cam.pos.x = ( rand( -15, 10 ) ) to ( rand( -10, 15 ) ) in #0.1
	#0.1 cam.pos.y = 10
	#0.1 cam.pos.z = ( rand( -15, 10 ) ) to ( rand( -10, 15 ) ) in #0.1

	#0.2 cam.pos.x = 10
	#0.2 cam.pos.y = ( rand( -15, 10 ) ) to ( rand( -10, 15 ) ) in #0.1
	#0.2 cam.pos.z = ( rand( -15, 10 ) ) to ( rand( -10, 15 ) ) in #0.1

	#0.3 cam.pos.x = ( rand( -20, 10 ) ) to 0 in #0.1
	#0.3 cam.pos.y = ( rand( -20, 10 ) ) to 0 in #0.1
	#0.3 cam.pos.z = ( rand( -20, 10 ) ) to 0 in #0.1
	
	#0.3 enable( layer1 )
	#0.3 disable( back, glow )
	#0.3 layer1.show = 0
	#0.3.5 layer1.show = 1
	#1.0 disable( layer1 )
	#1.0 enable( back, glow )
End

Sub:scene2
    #0.0 disable( obu1, layer1 )
    #0.0 enable( obu2 )
    
    #0.0 cam.pos.x = 5
    #0.0 cam.pos.y = 5
    #0.0 cam.pos.z = 5
    #0.0 glow.show = 1
    #0.0 cam.up.y = 100
    #0.0 obu2.rotate.x = 0 to 1000 in #8.0
    #0.0 obu2.rotate.z = 0 to 800 in #8.0
    #0.0 back.rotate = 360 to 0 in #8.0
    #0.0 back.zoom = 300 to 100 in #8.0

    #0.0 run( scene2_randomCam_4bars )    
    #4.0 run( scene2_randomCam_4bars )    
    #8.0 disable( obu2, layer1 )
End

Sub:scene2_randomCam_4bars
    #0.0 run( scene2_randomCam_beat )
    #0.2 run( scene2_randomCam_beat )
    #1.0 run( scene2_randomCam_beat )
    #1.2 run( scene2_randomCam_beat )
    #1.3 run( scene2_randomCam_beat )
    #2.0 run( scene2_randomCam_beat )
    #2.2 run( scene2_randomCam_beat )
    #3.0 run( scene2_randomCam_beat )
    #3.2 run( scene2_randomCam_beat )
    #3.3 run( scene2_randomCam_beat )
	#3.3 disable( back )
    #3.3 enable( layer1 )
    #3.3 layer1.brightness = 0 to 1 in #0.1
    #3.3 layer1.rotate = -45 to -60 in #0.1
	#3.3 layer1.show = 0
	#3.3.5 layer1.show = 1
	#4.0 enable( back )
    #4.0 disable( layer1 )
End

Sub:scene2_randomCam_beat
    #0.0 enable( obu2 )
    #0.0 cam.pos.x = ( rand( -3, 3, 0.01 ) )
    #0.0 cam.pos.y = ( rand( -3, 3, 0.01 ) )
    #0.0 cam.pos.z = ( rand( -3, 3, 0.01 ) )
    #0.1 disable( obu2 )
End

Sub:fist_4bars
    #0.0 enable( layer3 )
    #0.0 run( fist_beat, 200 )
    #0.1 run( fist_beat, 50 )
    #0.2 run( fist_beat, 400 )
    #0.3 run( fist_beat, 50 )
    #1.0 run( fist_beat, 200 )
    #1.1 run( fist_beat, 50 )
    #1.2 run( fist_beat, 400 )
    #1.3 run( fist_beat, 50 )
    #2.0 run( fist_beat, 200 )
    #2.1 run( fist_beat, 50 )
    #2.2 run( fist_beat, 400 )
    #2.3 run( fist_beat, 50 )
    #3.0 run( fist_beat, 200 )
    #3.1 run( fist_beat, 50 )
    #3.2 run( fist_beat, 400 )
    #3.3 run( fist_beat, 50 )
    #4.0 disable( layer3 )
End

Sub:fist_beat
    #0.0 layer3.show = 0
    #0.0 layer3.rotate = 0
    #0.0 layer3.zoom = 0 to %0 in #0.1
End

Sub:glowVariation1
	#0.0 run( glowVariation1_2bars )
	#2.0 run( glowVariation1_2bars )
	#4.0 run( glowVariation1_2bars )
	#6.0 run( glowVariation1_2bars )
End

Sub:glowVariation1_2bars
   #0.0 run( glowVariation1_beat )
   #0.1 run( glowVariation1_beat )
   #0.2 run( glowVariation1_beat )
   #0.3 run( glowVariation1_beat )
   #1.0 run( glowVariation1_beat )
   #1.1 run( glowVariation1_beat )
   #1.2 run( glowVariation1_beat )
   #1.3 run( glowVariation1_beat )
End

Sub:glowVariation1_beat
   #0.0 glow.zoom = 100 to ( rand( 200, 500 ) ) in #0.1
   #0.0 glow.rotate = 0 to ( rand( -30, 30 ) ) in #0.1
End

// end of file
